import {request} from '../utils/request.js'

const apiUrl = {
	getFavorPage: '/group/favor/getFavorPage',
	batchRemove: '/group/favor/batchRemove',
	getGoodsList: '/goods/getGoodsList',
	getGoodsBySearch: '/goods/searchGoods',
	getSessionId: '/user/getSessionId',
	authLogin: '/user/loginByOneClick',
	getUserInfo: '/user/userInfo'
}

export function authLogin(data) {
	return request(apiUrl.authLogin, 'POST', data)
}
export function getUserInfo(data) {
	return request(apiUrl.getUserInfo, 'GET', data)
}
export function getSessionId(data) {
	return request(apiUrl.getSessionId, 'GET', data)
}

export function getGoodsBySearch(data) {
	return request(apiUrl.getGoodsBySearch, 'POST', data )
}

export function getGoodsList(data) {
	return request(`${apiUrl.getGoodsList}?type=${data}`, 'GET' , data)
}

export function getFavorPage(data) {
	return request(apiUrl.getFavorPage, 'GET', data)
}

export function batchRemove(data) {
	return request(apiUrl.batchRemove, 'DELETE', data)
}
